// -------------------------------------------------------------------------
//    @FileName			:    {Filename}
//    @Author           :    GaoYi
//    @Date             :    2017-09-27
//    @Module           :   {Filename}
//
// -------------------------------------------------------------------------

#pragma once

#include "base/core/singleton.h"
#include "Common/MessageDispatch/IMessageDispatch.h"
#include <unordered_map>
#include "Common/ServerDefine.h"
#include "Common/AccountDefine.h"
#include "ProtoBuffer/ComProtocol.pb.h"
#include "ProtoBuffer/ClientToLogic.pb.h"
#include <queue>
#include <list>

class PointTurnMgr : public ManualSingleton<PointTurnMgr>,
	public IServerMessageHandler,
	public IClientMessageHandler
{
	friend class ManualSingleton<PointTurnMgr>;
public:
	PointTurnMgr() { }
	~PointTurnMgr() { }
public:
	bool Init();
	bool UnInit();

	virtual void		onServerMessage(uint32_t actionId, RECV_PACKAGE &package);
	virtual const char* getServerHandlerDebugInfo(void){ return nullptr; };

	virtual void        onClientMessage(uint32_t actionId, RECV_PACKAGE& package, uint64_t Id = 0);;
	virtual const char* getClientHandlerDebugInfo(void){ return nullptr; };
public:
	bool SendPointTurnChouJiang(RECV_PACKAGE& package);
	bool GetPointTurnChouJiangInfoHandle(CharIDType cid, RECV_PACKAGE& package);
public:
	std::list<ProtoBuf::PointTurnPlayerInfo> m_listInfo;
};

#define g_MakePointTurnMgrMgr() (PointTurnMgr::Instance())
#define g_GetPointTurnMgrMgr()  (PointTurnMgr::GetInstance())
#define g_DelPointTurnMgrMgr()  (PointTurnMgr::Destroy())